package collection.hash;


import org.junit.Test;

import java.util.concurrent.ConcurrentHashMap;

public class ConcurrentHashMapde {


    public static void main(String[] args) {
        ConcurrentHashMap<HashCodede, Integer> concurrentHashMap = new ConcurrentHashMap();
        for (int i = 0; i < 100; i++) {
            Integer put = concurrentHashMap.put(new HashCodede(i), i);
        }
        int size = concurrentHashMap.size();

        // 红黑树结点
        Integer treeBinHead = concurrentHashMap.get(new HashCodede(0));
        // 红黑树中间结点
        Integer treeBin = concurrentHashMap.get(new HashCodede(3));

        //树节点头节点
        Integer treeNodeHead = concurrentHashMap.get(new HashCodede(96));
        //树中间节点
        Integer treeNodeChain = concurrentHashMap.get(new HashCodede(99));


        //肯定不存在节点
        Integer nullNode = concurrentHashMap.get(new HashCodede(999999));

        System.out.printf("");
    }


    @Test
    public void commonTest(){
        ConcurrentHashMap<Integer, Integer> concurrentHashMap = new ConcurrentHashMap();
        for (int i = 0; i < 18; i++) {
            concurrentHashMap.put(i, i);
        }
        int size = concurrentHashMap.size();

        Integer integer = concurrentHashMap.get(9);

        Integer nullNode = concurrentHashMap.get(999999);

        System.out.println( );

    }

    @Test
    public void otherTest(){

        new ConcurrentHashMap(6);


    }


}
